﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
 
/// <summary>
/// Helper 的摘要说明
/// </summary>
public class ZoushiManage
{
    public ZoushiManage()
    {
    }
    /// <summary>
    /// 判断是否允许访问走势图
    /// </summary>
    public static void FangWenZouShi()
    {
        Model.CMember member = BLL.CMember.UserLoginInfo();
        if (member != null)
        {
            Model.MembershipGrade grade = BLL.MembershipGrade.GetModel(member.userLevel);
            if (member.Id > 0 && grade != null && grade.ID > 0 && grade.AllowZoushi)
            {
            }
            else
            {
              ///  System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('您的会员等级不允许您查看走势图！');window.location.href = 'Default.aspx';</script>");

            }
        }
        else
        {
            ///System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('请登录！');window.location.href = '/Default.aspx';</script>");

        }
    }
    /// <summary>
    /// 判断是否允许分析
    /// </summary>
    public static void AllowFenxi()
    {
        Model.CMember member = BLL.CMember.UserLoginInfo();
        if (member != null)
        {
            Model.MembershipGrade grade = BLL.MembershipGrade.GetModel(member.userLevel);
            if (member.Id > 0 && grade != null && grade.ID > 0 && grade.AllowFenxi)
            {
            }
            else
            {
                System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('您的会员等级不允许您查看分析！');window.location.href = 'Default.aspx';</script>");

            }
        }
        else
        {
            System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('请登录！');window.location.href = 'Default.aspx';</script>");

        }
    }
    /// <summary>
    /// 判断是否允许评论
    /// </summary>
    public static void AllowPinglun()
    {
        Model.CMember member = BLL.CMember.UserLoginInfo();
        if (member != null)
        {
            Model.MembershipGrade grade = BLL.MembershipGrade.GetModel(member.userLevel);
            if (member.Id > 0 && grade != null && grade.ID > 0 && grade.AllowPinglun)
            {
            }
            else
            {
                System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('您的会员等级不允许您查看评论！');window.location.href = 'Default.aspx';</script>");

            }
        }
        else
        {
            System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('请登录！');window.location.href = 'Default.aspx';</script>");

        }
    }
    /// <summary>
    /// 判断是否允许预测
    /// </summary>
    public static void AllowYuCe()
    {
        Model.CMember member = BLL.CMember.UserLoginInfo();
        if (member != null)
        {
            Model.MembershipGrade grade = BLL.MembershipGrade.GetModel(member.userLevel);
            if (member.Id > 0 && grade != null && grade.ID > 0 && grade.AllowYuCe)
            {
            }
            else
            {
                System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('您的会员等级不允许您查看预测！');window.location.href = 'Default.aspx';</script>");

            }
        }
        else
        {
            System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('请登录！');window.location.href = 'Default.aspx';</script>");

        }
    }
    /// <summary>
    /// 判断是否允许购彩
    /// </summary>
    public static void AllowGouCai()
    {
        Model.CMember member = BLL.CMember.UserLoginInfo();
        if (member != null)
        {
            Model.MembershipGrade grade = BLL.MembershipGrade.GetModel(member.userLevel);
            if (member.Id > 0 && grade != null && grade.ID > 0 && grade.AllowGouCai)
            {
            }
            else
            {
                System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('您的会员等级不允许您查看购彩！');window.location.href = 'Default.aspx';</script>");

            }
        }
        else
        {
            System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('请登录！');window.location.href = 'Default.aspx';</script>");

        }
    }
}
